package top.xin1901.j2ecd.dao;

import org.springframework.stereotype.Repository;
import top.xin1901.j2ecd.beans.Permission;
import top.xin1901.j2ecd.beans.Role;
import top.xin1901.j2ecd.beans.dbo.PermissionDbO;
import top.xin1901.j2ecd.beans.dbo.RoleDbO;

import java.util.List;

/**
 * @author HeYunjia
 */

@Repository
public interface RoleDao {
    int insert(RoleDbO role);
    int insertPermissions(Long roleId, List<Long> permissionIds);

    int deleteByPrimaryKey(Long roleId);
    int deletePermissions(Long roleId);

    int updateByPrimaryKey(RoleDbO role);
    int updatePermissions(Long roleId, List<Long> permissions);

    List<Role> selectAll();
    Role selectOne(Long roleId);

    List<RoleDbO> selectRoleDbO(Long groupId);
}
